<?php 


session_start();

//引入函数库
include './function.php';
//读取数据库
$data = file_get_contents('./Db/msg.txt');
//转数组
$data  = json_decode($data,true);
//排序
krsort($data);

$num = 3;

$total = count($data);

$Tpage = ceil($total/$num);

$p = isset($_GET['p']) ? $_GET['p'] : 1;

$data = array_slice($data, ($p-1)*$num,$num,true);

//引入首页模板
include './Tpl/index.html';

 ?>